﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Framework.Configurations
{
    public interface IXmlTree
    {
        /// <summary>
        /// 取得单一对应的节点的集合
        /// </summary>
        IXmlNodeCollection Node { get;}

        /// <summary>
        /// 取得多节点集合的集合
        /// </summary>
        IXmlNodesCollection Nodes { get;}

        /// <summary>
        /// 保存到默认的配置文件 pixysoft.config
        /// </summary>
        void Save();

        /// <summary>
        /// 保存到指定的配置文件
        /// </summary>
        /// <param name="filepath"></param>
        void Save(string filepath);

        /// <summary>
        /// 对象进行序列化
        /// </summary>
        /// <returns></returns>
        List<string> Serialize();

        /// <summary>
        /// 对象进行序列化
        /// </summary>
        /// <returns></returns>
        List<string> Serialize(bool indent);

        /// <summary>
        /// 全部序列化
        /// </summary>
        /// <returns></returns>
        string SerializeAll();

        /// <summary>
        /// 全部序列化
        /// </summary>
        /// <returns></returns>
        string SerializeAll(bool indent);

        /// <summary>
        /// 序列化为对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        List<T> Serialize<T>();
    }
}
